package com.netmarch.common.controller;


import java.util.Date;
import java.util.List;
import java.util.UUID;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.netmarch.common.Md5Util;
import com.netmarch.entity.User;
import com.netmarch.service.UserService;
/**
 * 登录模块
 * @author 袁宁康
 *
 */
@Controller
public class LoginController {
	
	@Autowired
	private UserService us;
	
	/**
	 * 登录界面跳转
	 * @return
	 */
	@RequestMapping("/login")
	public String login() {
		return "login";
	}
	/**
	 * 注册页面跳转
	 * @return
	 */
	@RequestMapping("/prec")
	public String prec() {
		return "prec";
	}
	
	@RequestMapping("/loginadd")
	@ResponseBody
	public Object loginadd(HttpServletRequest request, User bean) {
		List<User> list = us.getAllByName(bean.getTel());
		System.out.println(list.size());
		return "success";
	}
	
	@RequestMapping("/socket")
	public String socket() {
		return "WebSocket";
	}
	
	
}
